package 设计模式.创建型模式.demo04原型模式.demo1自行实现;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author: 王富贵
 * @description: 狗类测试
 * @createTime: 2022/11/07 15:50
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Dog implements PrototypeClone{
    private String name;
    public String likeFood;

    public Dog(Dog dog) {
        this.name = dog.name;
        this.likeFood = dog.likeFood;
    }

    @Override
    public PrototypeClone clone() {
        return new Dog(this);
    }
}
